<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'news-form',
    'enableAjaxValidation' => false,
    'enableClientValidation' => true,
    'htmlOptions' => array(
        'class' => 'form-horizontal',
        'enctype' => 'multipart/form-data',
    ),
        ));
?>
<div class="row-fluid">
            <div class="span12">
                <!--PAGE CONTENT BEGINS-->

                <div class="control-group">
                    <label class="control-label">Title</label>
                    <div class="controls">
                        <?php echo $form->textField($model,'title',array('maxlength'=>"100", "size"=>"60",'placeholder' => 'Title'))?>
                        <span class="help-inline"><?php echo $form->error($model, 'title'); ?></span>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">Link url</label>
                    <div class="controls">
                        <?php echo $form->textField($model,'link',array('maxlength'=>"100", "size"=>"60",'placeholder' => 'Link url'))?>
                        <span class="help-inline"><?php echo $form->error($model, 'link'); ?></span>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">Cover photo</label>
                    <div class="controls span3" style="margin:10px">
                        <?php echo $form->fileField($model, 'cover_photo', array('class' => 'id-input-file-1')); ?>
                        <span class="help-inline"><?php echo $form->error($model, 'cover_photo'); ?></span>
                    </div>
                </div>

                <div class="control-group">
                    <div class="controls">
                        <?php if($model['cover_photo']):?>
                            <img src="<?php echo Yii::app()->baseUrl.'/timthumb.php?src=' . Yii::app()->baseUrl .'/images/ads/'. $model['cover_photo']?>&h=100&w=100">
                        <?php endif;?>
                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">Status</label>
                    <div class="controls">
                        <?php 
                        echo $form->dropDownlist($model, 'disabled', MyFunctionCustom::$status);?>
                    </div>
                </div>

                <div class="clear"></div>
            </div>
            <!--PAGE CONTENT ENDS-->
        </div><!--/.row-fluid-->
    </div>
    <div class="form-actions">
                    <button class="btn btn-info" type="submit">
                        <i class="icon-ok bigger-110"></i>
                        Submit
                    </button>
                </div>
</div>        

<?php $this->endWidget(); ?>